home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5WPR009.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
3KB
|
98 lines
When I create a document in Word for Windows, I often need
to use dashes, the copyright symbol, the registered
trademark symbol, and other characters that are available
only via combinations of the <Alt> key and digits on the
Insert·Symbol menu. Rather than trying to commit every
sequence of keystrokes to memory or select what I need from
a table with 256 options, I wrote a macro that gives me easy
access to the symbols that I use most. The macro creates a
dialog box with buttons for the special characters and
assigns each a shortcut key for fast access. It then uses
WordBasic's Insert statement to send the character.
Vijay Ramachandran
Armonk, New York
Editor's Note: To create this macro, start Word for Windows
and use the Insert·File... command to import the text of the
macro from the file P5WPR\SPECCHAR.TXT (found on your
PowerBase *.* Volume 5 diskette) into a new Word for Windows
document. Then copy the body of the macro to the clipboard,
omitting the Sub Main statement at the top and the End Sub
statement at the bottom. Next, select Tools·Macros, type
InsertSpecial as your macro name, and select Edit. Paste the
macro text between the Sub and End Sub statements in the
macro editing window. Finally, double click on the "go away"
box in the upper left corner of the editing window and tell
Word for Windows that you want to save the macro.
This macro is pointless unless you can get to it easily from
the keyboard, so assign it a key for fast access. Select
Tools·Options and press K to get to the Keyboard Options
dialog box; from here assigning the macro to the key of your
choice is pretty much self-explanatory.I made one slight
improvement to this macro: turning the original OptionButton
commands to PushButtons. With this change, once the box is
up, PushButtons allow you to insert your selection with one
keystroke, whereas OptionButtons require two (the hot key
and <Enter>).
The text of the macro is shown below.
---- BEGIN LISTING ----
Sub Main
Begin Dialog UserDialog 325, 290
Text 10, 6, 144, 12, "Special Characters"
PushButton 10, 24, 210, 21, "E&m Dash"
PushButton 10, 47, 210, 21, "E&n Dash"
PushButton 10, 70, 210, 21, "&Open Double Quote"
PushButton 10, 94, 210, 21, "&Close Double Quote"
PushButton 10, 118, 210, 21, "Open &Single Quote"
PushButton 10, 142, 210, 21, "&Apostrophe"
PushButton 10, 166, 210, 21, "Co&pyright"
PushButton 10, 190, 210, 21, "&Registered Trademark"
PushButton 10, 214, 210, 21, "One &Fourth"
PushButton 10, 238, 210, 21, "One &Half"
PushButton 10, 262, 210, 21, "Three &Quarters"
CancelButton 230, 3, 88, 21
End Dialog
Dim Characters As UserDialog
On Error Goto Goodbye
ChoiceMade = Dialog(Characters)
Select Case ChoiceMade
Case 1
Insert Chr$(150)
Case 2
Insert Chr$(151)
Case 3
Insert Chr$(147)
Case 4
Insert Chr$(148)
Case 5
Insert Chr$(145)
Case 6
Insert Chr$(146)
Case 7
Insert Chr$(169)
Case 8
Insert Chr$(174)
Case 9
Insert Chr$(188)
Case 10
Insert Chr$(189)
Case 11
Insert Chr$(190)
Case Else
End Select
GoodBye:
End Sub
---- END LISTING ----
Title: Wielding Wild Characters
Category: WPR
Issue Date: December, 1992
Editor: Brett Glass
Supplementary Files: P5WPR\SPECCHAR.TXT
Filename: P5WPR009.TIP